﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLK.Database.DALs;

namespace QLK.Database.BLLs
{
    public class ExportInvoiceBLL
    {
        private ExportInvoiceDAL dal;

        public ExportInvoiceBLL()
        {
            dal = new ExportInvoiceDAL();
        }

        public List<ExportInvoice> ExportInvoiceGetAll()
        {
            return dal.ExportInvoiceGetAll();
        }

        public ExportInvoice ExportInvoiceGetByID(int ExpID)
        {
            if (ExpID > 0)
                return dal.ExportInvoiceGetByID(ExpID);
            return null;
        }

        public bool ExportInvoiceInsert(ExportInvoice Exps)
        {
            if (dal.ExportInvoiceCheckDulicateInvoiceID(Exps.InvoceID))
                return dal.ExportInvoiceInsert(Exps);
            return false;
        }

        public bool ExportInvoiceDeleteByID(int ExpID)
        {
            return dal.ExportInvoiceDeleteByID(ExpID);
        }

        public bool ExportInvoiceUpdate(ExportInvoice Exps)
        {
            if (dal.ExportInvoiceCheckDulicateInvoiceID(Exps.InvoceID))
                return dal.ExportInvoiceUpdate(Exps);
            return false;
        }

        public ExportInvoice ExportInvoiceGetByInvoiceID(string invoiceid)
        {
            return dal.ExportInvoiceGetByInvoiceID(invoiceid);
        }

        public List<ExportInvoices_GetProductByExportIDandStorageIDResult>
            ExportInvoices_GetProductByExportIDandStorageID(int ExportID, int StorageID)
        {
            return dal.ExportInvoices_GetProductByExportIDandStorageID(ExportID, StorageID);
        }
    }
}
